﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="employee.aspx.vb" Inherits="prueba.WebForm2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
    .style1
    {
        height: 21px;
    }
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table id="table1" style="width: 100%;">
    <tr>
        <td>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                DataKeyNames="emp_id" DataSourceID="employeeSqlDataSource1">
                <Columns>
                    <asp:BoundField DataField="emp_id" HeaderText="emp_id" ReadOnly="True" 
                        SortExpression="emp_id" />
                    <asp:BoundField DataField="fname" HeaderText="fname" 
                        SortExpression="fname" />
                    <asp:BoundField DataField="minit" HeaderText="minit" 
                        SortExpression="minit" />
                    <asp:BoundField DataField="lname" HeaderText="lname" SortExpression="lname" />
                    <asp:BoundField DataField="job_id" HeaderText="job_id" 
                        SortExpression="job_id" />
                    <asp:BoundField DataField="job_lvl" HeaderText="job_lvl" 
                        SortExpression="job_lvl" />
                    <asp:BoundField DataField="pub_id" HeaderText="pub_id" 
                        SortExpression="pub_id" />
                    <asp:BoundField DataField="hire_date" HeaderText="hire_date" 
                        SortExpression="hire_date" />
                </Columns>
            </asp:GridView>
            <asp:SqlDataSource ID="employeeSqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:pubsConnectionString9 %>" 
                DeleteCommand="DELETE FROM [employee] WHERE [emp_id] = @emp_id" 
                InsertCommand="INSERT INTO [employee] ([emp_id], [fname], [minit], [lname], [job_id], [job_lvl], [pub_id], [hire_date]) VALUES (@emp_id, @fname, @minit, @lname, @job_id, @job_lvl, @pub_id, @hire_date)" 
                SelectCommand="SELECT * FROM [employee]" 
                
                UpdateCommand="UPDATE [employee] SET [fname] = @fname, [minit] = @minit, [lname] = @lname, [job_id] = @job_id, [job_lvl] = @job_lvl, [pub_id] = @pub_id, [hire_date] = @hire_date WHERE [emp_id] = @emp_id">
                <DeleteParameters>
                    <asp:Parameter Name="emp_id" Type="String" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:ControlParameter ControlID="TxtBox1emp_id" Name="emp_id" 
                        PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="TxtBox2fname" Name="fname" PropertyName="Text" 
                        Type="String" />
                    <asp:ControlParameter ControlID="TxtBox3minit" Name="minit" PropertyName="Text" 
                        Type="String" />
                    <asp:ControlParameter ControlID="TxtBox4lname" Name="lname" PropertyName="Text" 
                        Type="String" />
                    <asp:ControlParameter ControlID="TxtBox5job_id" Name="job_id" 
                        PropertyName="Text" Type="Int16" />
                    <asp:ControlParameter ControlID="TxtBox6job_lvl" Name="job_lvl" 
                        PropertyName="Text" Type="Byte" />
                    <asp:ControlParameter ControlID="TxtBox7pub_id" Name="pub_id" 
                        PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="TxtBox8hire_date" Name="hire_date" 
                        PropertyName="Text" Type="DateTime" />
                </InsertParameters>
                <UpdateParameters>
                    <asp:Parameter Name="fname" Type="String" />
                    <asp:Parameter Name="minit" Type="String" />
                    <asp:Parameter Name="lname" Type="String" />
                    <asp:Parameter Name="job_id" Type="Int16" />
                    <asp:Parameter Name="job_lvl" Type="Byte" />
                    <asp:Parameter Name="pub_id" Type="String" />
                    <asp:Parameter Name="hire_date" Type="DateTime" />
                    <asp:Parameter Name="emp_id" Type="String" />
                </UpdateParameters>
            </asp:SqlDataSource>
        </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label1" runat="server" Text="emp_id"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox1emp_id" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label2" runat="server" Text="fname"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox2fname" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label3" runat="server" Text="minit"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox3minit" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label4" runat="server" Text="lname"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox4lname" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label5" runat="server" Text="job_id"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox5job_id" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td class="style1">
                    <asp:Label ID="Label6" runat="server" Text="job_lvl"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox6job_lvl" runat="server"></asp:TextBox>
                </td>
        <td class="style1">
            </td>
        <td class="style1">
            </td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label7" runat="server" Text="pub_id"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox7pub_id" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label8" runat="server" Text="hire_date"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox8hire_date" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Button ID="Button1" runat="server" Text="Enviar" />
                    <asp:Button ID="Button2" runat="server" Text="BORRAR" />
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
</table>
</asp:Content>
